﻿using System;
using System.IO;

namespace ByteFarm.ImageLibraryBuilder
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            Console.WriteLine(@"Walks all subdirectories within the given source directory.
It moves files matching the given filter into a sub directory of the given target directory grouped by year/month. 
Works with files based on the Tiff format including Olympus ORF. 
Also deletes files from the source tree which match provided file extensions and deletes empty directories");

            string sdir = Prompt("Enter the source directory");
            string tdir = Prompt("Enter the target directory");

            DirectoryInfo sourceDirectory = new DirectoryInfo(sdir);
            DirectoryInfo targetDirectory = new DirectoryInfo(tdir);


            Librarian.Run(sourceDirectory, targetDirectory, Prompt("Move files with extensions:").Split(',', ';'),
                          Prompt("Delete files with extensions:").Split(',', ';'));
        }

        private static string Prompt(string p)
        {
            Console.WriteLine(p);
            return Console.ReadLine();
        }
    }
}